package com.qeado.content.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qeado.common.dao.BaseDao;
import com.qeado.content.dao.PlantAreaManageDao;
import com.qeado.content.model.PlantArea;

@Repository
@SuppressWarnings("unchecked")
public class PlantAreaManageDaoImpl extends BaseDao implements PlantAreaManageDao {

	@Override
	public void deletePlantArea(String id) {
		getSqlMapClientTemplate().delete("deletePlantArea", id);
	}

	@Override
	public List<PlantArea> getPlantTypeList() {
		return getSqlMapClientTemplate().queryForList("getPlantTypeList");
	}

	@Override
	public List<PlantArea> getProvinceList() {
		return getSqlMapClientTemplate().queryForList("getProvinceList");
	}

	@Override
	public void insertPlantArea(PlantArea plantArea) {
		getSqlMapClientTemplate().insert("insertPlantArea", plantArea);
	}

	@Override
	public void savePlantArea(PlantArea plantArea) {
		getSqlMapClientTemplate().update("savePlantArea", plantArea);
	}

	@Override
	public List<PlantArea> searchPlantArea(PlantArea plantArea) {
		return getSqlMapClientTemplate().queryForList("searchPlantArea", plantArea);
	}

	@Override
	public PlantArea searchPlantAreaById(String id) {
		return (PlantArea) getSqlMapClientTemplate().queryForObject("searchPlantAreaById", id);
	}

}
